package ca.mcgill.model.functional;

import ca.mcgill.model.functional.triggering.Event;

public class Transition {

	private Action action;

	private State srcState;

	private State dstState;

	private Event trigE;

	private Event outE;

	private String name;

	private float relativeDeadline;

	public Transition(String name, Action action) {
		this.name = name;
		this.action = action;
	}

	public Transition(String name, Action action, State srcState,
			State dstState, Event trigE, Event outE) {
		this.name = name;
		this.action = action;
		this.srcState = srcState;
		this.srcState.addOutTransition(this);
		this.dstState = dstState;
		this.dstState.addInTransition(this);
		this.trigE = trigE;
		this.outE = outE;
	}

	public Action getAction() {
		return action;
	}

	public void setSrcState(State srcState) {
		this.srcState = srcState;
		this.srcState.addOutTransition(this);
	}

	public State getSrcState() {
		return srcState;
	}

	public void setDstState(State dstState) {
		this.dstState = dstState;
		this.dstState.addInTransition(this);
	}

	public State getDstState() {
		return dstState;
	}

	public Event getTrigE() {
		return trigE;
	}

	public void setTrigE(Event trigE) {
		this.trigE = trigE;
	}

	public Event getOutE() {
		return outE;
	}

	public void setOutE(Event outE) {
		this.outE = outE;
	}

	public String getName() {
		return name;
	}

	public void setRelativeDeadline(float relativeDeadline) {
		this.relativeDeadline = relativeDeadline;
	}

	public float getRelativeDeadline() {
		return this.relativeDeadline;
	}

}
